/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.store;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.model.SelectItem;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.M010;
import queenb.web.util.PackageContants;

/**
 *
 * @author VANANH
 */
public class M010Store extends M010 {

    public List<M010> mcurpks_listoftabm000(int pnFH000, int pnFH200, int pnFM000, String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.mcurpks_listoftabm010, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFM000),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });

        return super.find(dataStatement, M010.class);
    }


    public int stdm_tools_inserttabm000(int pnPM010,String pvMV011, String pvMV012,int pnFM000,String pvLOGIN) {
        try {
            DataStatement updateStatement = new DataStatement(PackageContants.stdm_tools_inserttabm010, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPM010),                           
                        new Param(OracleTypes.CHAR, pvMV011),
                        new Param(OracleTypes.CHAR, pvMV012),
                         new Param(OracleTypes.INTEGER, pnFM000),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(updateStatement, M010.class);
        } catch (SQLException ex) {

            return 0;
        }

    }
}
